package main

import (
	"fmt"
	"os"
)

func f2()  {
	fileObj,err := os.OpenFile("1.txt",os.O_RDWR,0644)
	if err !=nil {
		fmt.Printf("open file failed")
		return
	}
	defer fileObj.Close()
	fileObj.Seek(1,0) //光标移动
	var ret [1]byte

	n,nErr:=fileObj.Read(ret[:])
	if nErr !=nil{
		fmt.Printf("read failed,err:%v\n",nErr)
		return
	}
	fmt.Print(n)
	fmt.Printf(string(ret[:n]))

}

func main()  {

	f2()
}
